﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ProjectThuCung.Models;

namespace ProjectThuCung.Controllers
{
    public class AUserController : Controller
    {
        private ThuCungDB db = new ThuCungDB();

        //
        // GET: /AUser/

        public ActionResult Index()
        {
            //return View(db.Users.ToList());
            return View();
        }

        //
        // GET: /AUser/Details/5

        public ActionResult Details(int id = 0)
        {
            //User user = db.Users.Find(id);
            //if (user == null)
            //{
            //    return HttpNotFound();
            //}
            //return View(user);
            return View();
        }

        ////
        //// GET: /AUser/Create

        //public ActionResult Create()
        //{
        //    return View();
        //}

        ////
        //// POST: /AUser/Create

        //[HttpPost]
        //public ActionResult Create(User user)
        //{
        //    //if (ModelState.IsValid)
        //    //{
        //    //    db.Users.Add(user);
        //    //    db.SaveChanges();
        //    //    return RedirectToAction("Index");
        //    //}

        //    //return View(user);
        //    return View();
        //}

        ////
        //// GET: /AUser/Edit/5

        //public ActionResult Edit(int id = 0)
        //{
        //    //User user = db.Users.Find(id);
        //    //if (user == null)
        //    //{
        //    //    return HttpNotFound();
        //    //}
        //    //return View(user);
        //    return View();
        //}

        ////
        //// POST: /AUser/Edit/5

        //[HttpPost]
        //public ActionResult Edit(User user)
        //{
        //    if (ModelState.IsValid)
        //    {
        //        db.Entry(user).State = EntityState.Modified;
        //        db.SaveChanges();
        //        return RedirectToAction("Index");
        //    }
        //    return View(user);
        //}

        ////
        //// GET: /AUser/Delete/5

        //public ActionResult Delete(int id = 0)
        //{
        //    User user = db.Users.Find(id);
        //    if (user == null)
        //    {
        //        return HttpNotFound();
        //    }
        //    return View(user);
        //}

        ////
        //// POST: /AUser/Delete/5

        //[HttpPost, ActionName("Delete")]
        //public ActionResult DeleteConfirmed(int id)
        //{
        //    User user = db.Users.Find(id);
        //    db.Users.Remove(user);
        //    db.SaveChanges();
        //    return RedirectToAction("Index");
        //}

        //protected override void Dispose(bool disposing)
        //{
        //    db.Dispose();
        //    base.Dispose(disposing);
        //}
    }
}